package com.allwees.bs.configuration;

import com.allwees.bs.core.model.constant.CacheName;
import com.allwees.core.cache.configuration.InitialCache;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class CacheConfiguration extends InitialCache {

    /**
     * 配置各个Cache的生命周期
     *
     * @return
     */
    @Override
    protected Map<String, Integer> initialCaches() {
        Map<String, Integer> caches = new HashMap<>();
        caches.put(CacheName.AB_ORDER_STATISTICS_WAIT_PAY_COUNT, 60 * 30);
        caches.put(CacheName.AB_ORDER_STATISTICS_WAIT_SHIP_COUNT, 60 * 30);
        caches.put(CacheName.AB_ORDER_STATISTICS_WAIT_REVIEW_COUNT, 60 * 30);
        caches.put(CacheName.AB_ORDER_STATISTICS_REFUNDED_COUNT, 60 * 30);
        caches.put(CacheName.AB_ORDER_STATISTICS_YESTERDAY_DEAL_AMT, 60 * 30);
        caches.put(CacheName.AB_ORDER_STATISTICS_TODAY_DEAL_AMT, 60 * 30);
        caches.put(CacheName.AB_ORDER_STATISTICS_TOTAL_DEAL_AMT, 60 * 30);
        caches.put(CacheName.AB_ORDER_STATISTICS_REFUNDED_DEAL_AMT, 60 * 30);
        return caches;
    }
}
